<template>
  <div class="showView">
    <div class="history">
      {{history_data}}
    </div>
    <div class="result" :class="{'isSmall':isSmall}">
      {{result_data}}
    </div>
  </div>
</template>

<script>
export default {
  name: "ShowView",
  data(){
    return{
      // result_data: 10,
      // history_data: 55
      isSmall: false,
    }
  },
  computed:{
    history_data(){
      let str = this.$store.state.history_data.toString();
      return str;
      // if (str.length > 11){
      //   console.log('To Long');
      //   return str.substring(str.length-13,str.length-1);
      // }else {
      //   return str;
      // }
    },
    result_data(){
      let str = this.$store.state.result_data.toString();
      this.isSmall = str.length > 13;
      return str;
    }
  }

}
</script>

<style scoped lang="css">
  .showView{
    width: 100%;
    height: 130px;
    /*margin: auto;*/
    /*margin-top: 10px;*/
    border-radius: 8px;
    box-shadow: -1px -1px 2px #bbbbbb;
    background: white;
    padding: 12px;
    box-sizing: border-box;
  }
  .history{
    text-align: end;
    color: rgb(159, 163, 179);
    font-size: 16px;
    height: 20px;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    /*direction: rtl;*/
  }
  .result{
    width: 100%;
    padding-top: 10px;
    font-weight: bold;
    font-size: 60px;
    text-align: end;
    overflow: hidden;
    height: 90px;
    line-height: 90px;
    white-space: nowrap;
    /*direction: rtl;*/
  }
  .isSmall{
    font-size: 30px;
  }
</style>